package com.atguigu.gulimall.order;

import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * #  设置消息手动确认
 *     listener:
 *       simple:
 *         acknowledge-mode: manual
 *
 *rabbitmq消息确认机制
 *
 * spring.rabbitmq.publisher-confirm = true开启发送端确认
 *
 * provider  ---生产消息发送给rabbitmq--->   [Broker(rabbitmq 服务器)   exchange ----投递消息 ------>  Queue   ]  --转发给消费者-->   consumer
 *                            服务器收到消息将触发 confirmCallback    交换机未投递到queue将触发 returnCallback   队列和消费者直接有ack确认机制
 *    callBack都是服务器给消息生产者的回调
 *
 */
@EnableRedisHttpSession
@SpringBootApplication
@EnableDiscoveryClient
@EnableRabbit
@EnableFeignClients
@EnableTransactionManagement
public class GulimallOrderApplication {

    public static void main(String[] args) {
        SpringApplication.run(GulimallOrderApplication.class, args);
    }

}
